/*
** init_args_port.c for dayday in /home/dd/projs/dayday/srcs/client
** 
** Made by dd
** Login   <alletr_p@epitech.net>
** 
** Started on  Tue Jul 21 19:51:26 2009 dd
** Last update Tue Jul 21 21:01:49 2009 dd
*/

#include <stdlib.h>
#include <assert.h>

#include "client.h"

int	init_args_port(t_all *all, char *optarg)
{
  int	p;

  assert(all && optarg);
  p = atoi(optarg);  
  if (p <= 0)
    {
      print(STRERR_ARGS_PORT);
      return (FAILURE);
    }
  all->network.port = p;
  return (SUCCESS);
}
